<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<%@ include file="/commons/kindeditor.jsp" %>
<script type="text/javascript">
    $(function() {
    	//初始化类目选择和图片上传器
		TAOTAO.init({fun:function(node){}});
        $('#weChatEditForm').form({
            url : '${path}/admin/weChat/edit',
            onSubmit : function() {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success : function(result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.success) {
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
                    parent.$.modalDialog.handler.dialog('close');
                } else {
                    parent.$.messager.alert('错误', result.msg, 'error');
                }
            }
        });
    });
</script>
<div style="padding:10px 10px 10px 10px">
        <form id="weChatEditForm" method="post" enctype="multipart/form-data">
            <table class="grid">
				<input id="id" name="id" type="hidden" value="${weChat.id}" />
				<tr>
					<td>头像:</td>
					<td colspan="3">
						<a href='${weChat.headImgUrl}' target='_blank' class=''>
							<img src='${weChat.headImgUrl}' height='60px'/>
						</a>
						<input name="headImgUrl" type="hidden"value="${weChat.headImgUrl}" />
					</td>
				</tr>
				<tr>
					<td>openId:</td>
					<td>
						<input id="openId" name="openId" type="text" placeholder="请输入open_id" class=" easyui-textbox" data-options="required:true,width:250"  value="${weChat.openId}" />
					</td>
					<td>unionId:</td>
					<td>
						<input id="unionId" name="unionId" type="text" placeholder="请输入union_id" class=" easyui-textbox" data-options="width:250"  value="${weChat.unionId}" />
					</td>
				</tr>
				<tr>
					<td>微信昵称:</td>
					<td>
						<input id="nikeName" name="nikeName" type="text" placeholder="请输入nike_name" class=" easyui-textbox" data-options="width:200"  value="${weChat.nikeName}" />
					</td>
					<td>真实姓名:</td>
					<td>
						<input id="name" name="name" type="text" placeholder="请输入name" class=" easyui-textbox" data-options="width:200"  value="${weChat.name}" />
					</td>
				</tr>
				<tr>
					<td>性别:</td>
					<td>
						<select id="sex" name="sex" class="easyui-combobox" data-options="width:200,height:29,editable:false,panelHeight:'auto'">
							${dic:getBusDictListToOption("WECHAT_SEX")}
						</select>
					</td>
					<td>country:</td>
					<td>
						<input id="country" name="country" type="text" placeholder="请输入country" class=" easyui-textbox" data-options="width:200"  value="${weChat.country}" />
					</td>
				</tr>
				<tr>
					<td>是否关注:</td>
					<td>
						<select id="subscribe" name="subscribe" class="easyui-combobox" data-options="width:200,height:29,editable:false,panelHeight:'auto'">
							${dic:getBusDictListToOption("WECHAT_SUBSCRIBE")}
						</select>
					</td>
					<td>province:</td>
					<td>
						<input id="province" name="province" type="text" placeholder="请输入province" class=" easyui-textbox" data-options="width:200"  value="${weChat.province}" />
					</td>
				</tr>
				<tr>
					<td>语言:</td>
					<td>
						<input id="language" name="language" type="text" placeholder="请输入language" class=" easyui-textbox" data-options="width:200"  value="${weChat.language}" />
					</td>
					<td>city:</td>
					<td>
						<input id="city" name="city" type="text" placeholder="请输入city" class=" easyui-textbox" data-options="width:200"  value="${weChat.city}" />
					</td>
				</tr>
                <tr>
                    <td>关注时间:</td>
					<td>
						<input id="subscribeTime" name="subscribeTime" type="text" placeholder="请输入subscribe_time" class="easyui-datetimebox" data-options="width:200"  value="<fmt:formatDate pattern='yyyy-MM-dd HH:mm:ss' value='${weChat.subscribeTime}'/>"/>
					</td>
					<td>组别ID:</td>
					<td>
						<input id="groupId" name="groupId" type="text" placeholder="请输入group_id" class=" easyui-textbox" data-options="width:200"  value="${weChat.groupId}" />
					</td>
				</tr>
				<tr>
					<td>取关时间:</td>
					<td>
						<input id="removeDate" name="removeDate" type="text" placeholder="请输入取关时间" class="easyui-datetimebox" data-options="width:200"  value="<fmt:formatDate pattern='yyyy-MM-dd HH:mm:ss' value='${weChat.removeDate}'/>"/>
					</td>
					<td>状态:</td>
					<td>
						<select id="status" name="status" class="easyui-combobox" data-options="width:200,height:29,editable:false,panelHeight:'auto'">
							<option value="1">正常</option>
							<option value="0">停用</option>
						</select>

					</td>
				</tr>
				<script type="text/javascript">
                    //下拉框赋值
                    $("#status").val('${weChat.status}');
                    $("#sex").val('${weChat.sex}');
                    $("#subscribe").val('${weChat.subscribe}');
				</script>
            </table>
        </form>
    </div>
